#include "BinaryTree.h"
void Test1()
{
    char str[100] = "ABD##E#H##CF##G##";
    int i = 0;
    BTNode *tree = BinaryTreeCreate(str,&i);
    printf("前序遍历为:");
    BinaryTreePrevOrder(tree);
    printf("\n");
    printf("中序遍历为:");
    BinaryTreeInOrder(tree);
    printf("\n");
    printf("后序遍历为：");
    BinaryTreePostOrder(tree);
    printf("\n");
    printf("层序遍历为:");
    BinaryTreeLevelOrder(tree);
    printf("\n");
    printf("树的节点个数是%d个\n",BinaryTreeSize(tree));
    printf("叶节点个数是%d个\n", BinaryTreeLeafSize(tree));
    printf("倒数第3层的节点个数是%d\n", BinaryTreeLevelKSize(tree,3));
    if(BinaryTreeComplete(tree))
        printf("是完全二叉树\n");
    else
        printf("不是完全二叉树\n");
    BinaryTreeDestory(&tree);
}
void Test2()
{

}
int main()
{
    Test1();
//    Test2();
    return 0;
}